package o;

import com.huawei.appgallery.downloadengine.impl.DownloadTask;
import com.huawei.appgallery.downloadengine.impl.DownloadThreadInfo;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

class bng {
    private static final Object ˊ = new Object();
    public static final String ˏ = DownloadTask.class.getSimpleName();
    public static final String ॱ = DownloadThreadInfo.class.getSimpleName();
    private static bng ᐝ = null;
    public cfu ˋ = this.ॱॱ.ʽ(ˏ);
    public cfu ˎ = this.ॱॱ.ʽ(ॱ);
    private bnn ॱॱ = bnn.ˎ();

    public static bng ˏ() {
        bng o_bng;
        synchronized (ˊ) {
            if (ᐝ == null) {
                ᐝ = new bng();
            }
            o_bng = ᐝ;
        }
        return o_bng;
    }

    private bng() {
    }

    public List<DownloadThreadInfo> ॱ(String str) {
        if (str == null) {
            return new ArrayList();
        }
        return this.ˎ.ˋ(DownloadThreadInfo.class, "taskId_=?", new String[]{str}, null, null);
    }

    public List<DownloadTask> ˋ() {
        bnc.ˎ.ˋ("DownloadDAO", "DownloadDao getAllTask");
        List<DownloadTask> ˋ = this.ˋ.ˋ(DownloadTask.class, null);
        for (DownloadTask downloadTask : ˋ) {
            Collection ॱ = ॱ(String.valueOf(downloadTask.ʿ()));
            downloadTask.ˋ().clear();
            downloadTask.ˋ().addAll(ॱ);
        }
        return ˋ;
    }
}
